from selenium import webdriver
from selenium.webdriver.common.by import By
import time

# 1.打开浏览器
driver = webdriver.Chrome()

# 2.输入ecshop网址搜索首页
driver.get('https://ecshop.test2.shopex123.com')

# 3.点击登录选项
time.sleep(2)
driver.find_element(By.CLASS_NAME, 'sign').click()

# 4.获取用户名搜索框
time.sleep(2)
username = driver.find_element(By.NAME, 'username')
username.send_keys('veloday')
# 5.输入密码
time.sleep(2)
password = driver.find_element(By.NAME, 'password')
password.send_keys('wu123456')
# 8.输入账号密码后点击登录
time.sleep(2)
driver.find_element(By.NAME, 'submit').click()
# 9.退出浏览器
time.sleep(2)
driver.quit()